package edu.bu.manateem.msg.model;

/**
 * Ties compound with its intensity values per
 * file
 * @author gindin
 *
 */
public class IntensityValue
{
	private Integer numberOfScans = 0;
	private Double rawIntensity = 0.0;
	private Double relativeIntensity = 0.0;
	private String fileName;

	/**
	 * @return the numberOfScans
	 */
	public Integer getNumberOfScans() {
		return numberOfScans;
	}
	/**
	 * @param numberOfScans the numberOfScans to set
	 */
	public void setNumberOfScans(Integer numberOfScans) {
		this.numberOfScans = numberOfScans;
	}
	/**
	 * @return the rawIntensity
	 */
	public Double getRawIntensity() {
		return rawIntensity;
	}
	/**
	 * @param rawIntensity the rawIntensity to set
	 */
	public void setRawIntensity(Double rawIntensity) {
		this.rawIntensity = rawIntensity;
	}
	/**
	 * @return the relativeIntensity
	 */
	public Double getRelativeIntensity() {
		return relativeIntensity;
	}
	/**
	 * @param relativeIntensity the relativeIntensity to set
	 */
	public void setRelativeIntensity(Double relativeIntensity) {
		this.relativeIntensity = relativeIntensity;
	}
	
	public void increment (IntensityValue valueA)
	{
		this.numberOfScans += valueA.getNumberOfScans();
		this.rawIntensity += valueA.getRawIntensity();
		this.relativeIntensity += valueA.getRelativeIntensity();
	}

	public static IntensityValue add (IntensityValue valueA, IntensityValue valueB)
	{
		IntensityValue sum = new IntensityValue ();
		sum.setNumberOfScans(valueA.getNumberOfScans() + valueB.getNumberOfScans());
		sum.setRawIntensity(valueA.getRawIntensity() + valueB.getRawIntensity());
		sum.setRelativeIntensity(valueA.getRelativeIntensity() + valueB.getRelativeIntensity());
		return sum;
	}
	/**
	 * @return the fileName
	 */
	public String getFileName() {
		return fileName;
	}
	/**
	 * @param fileName the fileName to set
	 */
	public void setFileName(String fileName) {
		this.fileName = fileName;
	}
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "IntensityValue [numberOfScans=" + numberOfScans
				+ ", rawIntensity=" + rawIntensity + ", relativeIntensity="
				+ relativeIntensity + "]";
	}
}
